package com.yuke.cloud.service.tmc.job.simple;

import com.dangdang.ddframe.job.api.ShardingContext;
import com.dangdang.ddframe.job.api.simple.SimpleJob;
import com.yuke.cloud.elastic.lite.annotation.ElasticJobConfig;
import com.yuke.cloud.service.api.cmc.service.CmcFeignApi;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;

/*
 * <p>Company: Copyright (c) 2018. yuke All Rights Reserved. </br> </p>
 * <p>Title：yukemall </br> </p>
 * <p>com.yuke.cloud.service.tmc.job.simple Description TODO </br> </p>
 * @Author wg
 * @Date   2019/6/3 13:44
 */

/**
 * 定时启动加载秒杀活动的任务
 */
@Slf4j
@ElasticJobConfig(cron = "0 0 4 * * ?") // 每天凌晨4点触发
public class LoadSecKillJob implements SimpleJob {

    @Autowired
    private CmcFeignApi cmcFeignApi;

    /**
     * Execute.
     *
     * @param shardingContext the sharding context
     */
    @Override
    public void execute(final ShardingContext shardingContext) {
        cmcFeignApi.loadSecKillAndSpecs();
    }
}
